﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AndroidHelper
{
    // Android帮助库
    const string AndroidMainActivity = "com.unity3d.player.UnityPlayer";
    const string AndroidFileHelper = "com.onemt.utils.FileHelper";
    const string AndroidNotification = "com.onemt.notification.UnityNotificationManager";

    static AndroidJavaClass ms_FileHelper;
    public static AndroidJavaClass FileHelper
    {
        get
        {
            if (ms_FileHelper == null)
            {
                ms_FileHelper = new AndroidJavaClass(AndroidFileHelper);
            }

            return ms_FileHelper;
        }
    }

    static AndroidJavaClass ms_Notification;
    public static AndroidJavaClass Notification
    {
        get
        {
            if (ms_Notification == null)
            {
                ms_Notification = new AndroidJavaClass(AndroidNotification);
            }

            return ms_Notification;
        }
    }

    static AndroidJavaObject ms_MainActivity;
    public static AndroidJavaObject MainActivity
    {
        get
        {
            if (ms_MainActivity == null)
            {
                AndroidJavaClass jc = new AndroidJavaClass(AndroidMainActivity);
                if (jc != null)
                {
                    ms_MainActivity = jc.GetStatic<AndroidJavaObject>("currentActivity");
                }
            }

            return ms_MainActivity;
        }
    }
}
